﻿
namespace LS.Nc6.Application.System
{
    /// <summary>
    /// 菜单管理自定义方法
    /// </summary>
    public interface ISysMenuService : IBaseInterface<SysMenuEntity>
    {
        /// <summary>
        /// 根据条件获取对应的关系
        /// </summary>
        /// <param name="expression"></param>
        /// <returns></returns>
        Task<List<SysMenuFunctionEntity>> GetMenuFunction(Expression<Func<SysMenuFunctionEntity,bool>> expression);
        /// <summary>
        /// 保存菜单及功能
        /// </summary>
        /// <param name="model"></param>
        /// <param name="listModel"></param>
        /// <returns></returns>
        Task<int> InsertMenuFun(SysMenuEntity model,List<SysMenuFunctionEntity> listModel);

        /// <summary>
        /// 修改菜单及功能
        /// </summary>  
        /// <param name="model"></param>
        /// <param name="listModel"></param>
        /// <returns></returns>
       Task< int> UpdateMenuFun(SysMenuEntity model, List<SysMenuFunctionEntity> listModel);

        /// <summary>
        /// 获取自动菜单编号
        /// </summary>
        /// <param name="parentId"></param>
        /// <returns></returns>
        Task<int> GetMaxPartMenu(long parentId);


        /// <summary>
        /// 获取菜单 需要连接sys_menufunction
        /// </summary>
        /// <param name="expression"></param>
        /// <returns></returns>
        Task<List<SysMenuEntity>> MenuList(Expression<Func<SysMenuEntity, bool>> expression);

       
        /// <summary>
        /// 检查menucode是否可用
        /// </summary>
        /// <param name="menuCode"></param>
        /// <returns></returns>
        Task<bool> ExistsMenuCode(string menuCode);

        /// <summary>
        /// 获取菜单
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="mlevel"></param>
        /// <returns></returns>
        List<SysMenuEntity> GetUserPartMenu(long userId, int mlevel);
    }
}
